package com.qms.repast.weidgets;

import android.content.Context;

import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;

/**
 * @author 泅渡者
 * @date 2018/9/3 0031
 * @describe: 字体渐变 缩放效果
 */
public class ScaleTransitionPagerTitleView extends ColorTransitionPagerTitleView {
	private float mMinScale = 0.65f;

	public ScaleTransitionPagerTitleView (Context context) {
		super(context);
	}

	@Override
	public void onEnter (int index, int totalCount, float enterPercent, boolean leftToRight) {
		super.onEnter(index, totalCount, enterPercent, leftToRight);
		setScaleX(mMinScale + (1.0f - mMinScale) * enterPercent);
		setScaleY(mMinScale + (1.0f - mMinScale) * enterPercent);
	}

	@Override
	public void onLeave (int index, int totalCount, float leavePercent, boolean leftToRight) {
		super.onLeave(index, totalCount, leavePercent, leftToRight);
		setScaleX(1.0f + (mMinScale - 1.0f) * leavePercent);
		setScaleY(1.0f + (mMinScale - 1.0f) * leavePercent);
	}

	public float getMinScale () {
		return mMinScale;
	}

	public void setMinScale (float minScale) {
		mMinScale = minScale;
	}
}
